﻿############正则表达式###########3
import re

test = "010-413213"
if re.match("\d{3}\-\d{3,8}",test):
	print("OK");
else:
	print("failed");
print(re.match("\d{3}\-\d{3,8}",test));
###########切分字符串###########3
l = "a b   c".split(" ")
print(l)

l =re.split("\s+","a b    c")
print(l);
##########练习##########
# someone@gmail.com
# bill.gates@microsoft.com
test = "somdeone@gmail.com"
m = re.match("([0-9a-zA-Z]+)@[0-9a-zA-Z]+\.[0-9a-zA-Z]",test)
if m:
	print("OK");
else:
	print("failed");
print(m.group(0));
print(m.group(1));
